package structural.composite;

public class Course extends CatalogComponenet {
    private String name;
    private String price;

    public Course(String name,String price){
        this.name = name;
        this.price = price;
    }

    @Override
    public void add(CatalogComponenet catalogComponenet) {
        super.add(catalogComponenet);
    }

    @Override
    public void remove(CatalogComponenet catalogComponenet) {
        super.remove(catalogComponenet);
    }

    @Override
    public String getName(CatalogComponenet catalogComponenet) {
        return this.name;
    }

    @Override
    public String getPrice(CatalogComponenet catalogComponenet) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println("name:"+this.name+",价格："+this.price);
    }
}
